<?php
//************************
//        FUNÇÕES        *
//************************


/****************/
/* Codificar URL */
/****************/
function irPara($linkUrl)
{
	$pgUrl = urlencode(base64_encode($linkUrl));
	echo $pgUrl;
}

function pgForm($pg)
{
	$pgUrl = urlencode(base64_encode($pg));
	return $pgUrl;
}

/***********************************/
/* Limitar caracteres em uma frase */
/***********************************/
	function contastr($msg,$max){
	$tc = 0;
	$tam = strlen($msg);
	if($tam>$max){
	$sum = $tc - $max;
	$msg = substr($msg,0,-$sum)."...";
	}
	return $msg;
	}
	
?>